package it.gommonauti.quiz.patente.app;

import java.util.Set;

import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;

public class ResultActivity extends BaseActivity {

	private static final String DEBUG_TAG= "ResultActivity";
	
	@Override
	protected String getDebugTag() {
		return DEBUG_TAG;
	}

	/* (non-Javadoc)
	 * @see it.gommonauti.quiz.patente.app.BaseActivity#onCreate(android.os.Bundle)
	 */
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		
		Typeface tf = Typeface.createFromAsset(getAssets(), "ASTRO867.TTF");
		
		ScrollView mainScrollView = new ScrollView(this);
		LinearLayout mainLinearLayout = new LinearLayout(this);
		mainLinearLayout.setOrientation(LinearLayout.VERTICAL);
		mainScrollView.addView(mainLinearLayout);
		this.setContentView(mainScrollView);
		
		Bundle extras = getIntent().getExtras(); 
		if(extras !=null) {
		   
			Set<String> keys = extras.keySet();
			
			if (keys != null){
				
				for (int i = 0; i < keys.size(); i++) {
					
					String key = String.valueOf(i);
					String value = extras.getString(key);
					
					TextView mainQuestionTextView = new TextView(this);
					mainQuestionTextView.setText(value);
					
					//TODO : esternalize
					mainQuestionTextView.setTextColor(Color.rgb(3, 96, 176));
					
					mainQuestionTextView.setTypeface(tf);
					mainLinearLayout.addView(mainQuestionTextView);
				}
				
			} 
		}
		
	}

	
}
